import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/view/home/Home.vue'
import policyNotice from '@/view/policyInformation/policyNotice.vue'
import newsInfomation from '@/view/newsInfomation/Index.vue'
import inform from '@/view/inform/index.vue'
import departmentInside from '@/view/policyInformation/departmentInside.vue'
import policyMap from '@/view/policyInformation/policyMap.vue'
import fenPolicyMap from '@/view/policyInformation/fenPolicyMap.vue'

import fenProjectMap from '@/view/Project/fenProjectMap.vue'
import governmentUnscramble from '@/view/governmentUnscramble/index.vue'
import gUDetails from '@/view/governmentUnscramble/gUDetails.vue'
import subscriptionpage from '@/view/governmentUnscramble/subscription.vue'
import enterpriseClaim from '@/view/EnterpriseClaim/enterpriseClaim.vue'

import condition from '@/view/EnterpriseComparison/condition.vue'
import comparisonDetails from '@/view/EnterpriseComparison/comparisonDetails.vue'

import enterprise from '@/view/Enterprise/index.vue'

import honor from '@/view/Enterprise/honor.vue'
import patent from '@/view/Enterprise/patent.vue'
import brand from '@/view/Enterprise/brand.vue'
import soft from '@/view/Enterprise/soft.vue'
import companyPlolicy from '@/view/Enterprise/companyPlolicy.vue'
import vip from '@/view/VIP/userInfo/index.vue'
import viewHistory from '@/view/VIP/userInfo/viewHistory.vue'
import userInfo from '@/view/VIP/userInfo/userInfocentent.vue'
import information from '@/view/VIP/userInfo/information.vue'
import attention from '@/view/VIP/userInfo/attention.vue'
import vipEnterprise from '@/components/VIP/enterprise.vue'
import department from '@/components/VIP/department.vue'
import company from '@/view/VIP/userInfo/company.vue'
import order from '@/view/VIP/userInfo/order.vue'
import discover from '@/view/VIP/userInfo/discover.vue'
import statistics from '@/view/VIP/userInfo/statistics.vue'
import statisticsDetails from '@/view/VIP/userInfo/statistics_details.vue'
import discoveDetails from '@/view/VIP/userInfo/discover_details.vue'
import toExamine from '@/view/VIP/userInfo/toExamine.vue'
import enterpriseAuditForm from '@/view/VIP/userInfo/enterpriseAuditForm.vue'
import publishResults from '@/view/VIP/userInfo/publishResults.vue'
import publishDemand from '@/view/VIP/userInfo/publishDemand.vue'

import test from '@/view/test/index.vue'
import projectQuery from '@/view/Project/projectQuery.vue'
import projectMap from '@/view/Project/projectMap.vue'
import register from '@/view/VIP/register.vue'
import blankPage from '@/view/VIP/blankPage.vue'
import forget from '@/view/VIP/forget.vue'
import ParkCenter from '@/view/park/ParkCenter.vue'
import ParkCenterDetails from '@/view/park/ParkCenter_details.vue'
import login from '@/view/VIP/login.vue'
import search from '@/view/search/index.vue'
import match from '@/view/search/match.vue'
import aboutUs from '@/view/footer/aboutUs.vue'
import policyPage from '@/view/governmentUnscramble/policyPage.vue'
import publicDetail from '@/view/governmentUnscramble/publicDetail.vue'
import serveDedils from '@/view/serve/serveDedils.vue'
import dedils from '@/view/serve/dedils.vue'
import pageVIP from '@/view/VIP/pageVIP.vue'
import introduce from '@/view/footer/introduce.vue'

import nearbyEnterprise from '@/view/Enterprise/nearbyEnterprise.vue'
import newInform from '@/view/inform/newInform.vue'
import bindPhoneNumber from '@/view/VIP/bindPhoneNumber.vue'

import festival from '@/view/festival/Index.vue'
import patentList from '@/view/patentPayment/PatentList.vue'
import patentPayment from '@/view/patentPayment/payment.vue'
import patentSearch from '@/view/patentPayment/Search.vue'
import patentDetail from '@/view/patentPayment/patentDetail.vue'

import evaluation from '@/view/evaluation/Index.vue'

import achievDetail from '@/view/achievement/achievDetail.vue'
import achievList from '@/view/achievement/achievList.vue'

import demandDetail from '@/view/achievement/demandDetail.vue'
import demandList from '@/view/achievement/demandList.vue'

import companyService from '@/view/companyService/Index.vue'

import declareIndex from '@/view/declare/Index.vue'

Vue.use(Router)


export function createRouter() {
  let router = new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [{
        /* 首页 */
        path: "/",
        name: 'Home',
        meta: {
          title: '首页'
        },
        component: Home
      },
      /* 最新资讯 */
      {
        path: "/newsInfomation/:province?/:city?",
        name: 'newsInfomation',
        meta: {
          title: '最新资讯查询页'
        },
        component: newsInfomation
      },
      /* 政策通知 */
      {
        path: "/policyNotice/:province?/:city?/:area?/:value?",
        name: 'policyNotice',
        meta: {
          title: '政策通知查询页'
        },
        component: policyNotice
      },
      /* 政策通知详情 */
      {
        path: "/inform/:id",
        name: 'inform',
        meta: {
          title: '政策通知详情页'
        },
        component: inform
      },
      {
        path: "/policyDetail/:id",
        name: 'policyDetail',
        meta: {
          title: '政策通知详情页'
        },
        component: inform
      },
      /* 政策通知部门内页 */
      {
        path: "/departmentInside",
        name: 'departmentInside',
        meta: {
          title: '政策通知部门内页'
        },
        component: departmentInside
      },
      /* 政策图谱 */
      {
        path: "/policyMap",
        name: 'policyMap',
        meta: {
          title: '政策图谱页面'
        },
        component: policyMap
      },
      /* 分站政策图谱 */
      {
        path: "/fenPolicyMap",
        name: 'fenPolicyMap',
        meta: {
          title: '政策图谱页面'
        },
        component: fenPolicyMap
      },
      /* 分站项目图谱 */
      {
        path: "/fenProjectMap",
        name: 'fenProjectMap',
        meta: {
          title: '项目图谱页面'
        },
        component: fenProjectMap
      },
      /* 政策解读 */
      {
        path: "/governmentUnscramble/:province?/:city?",
        name: "governmentUnscramble",
        meta: {
          title: '政策解读查询页面'
        },
        component: governmentUnscramble
      },
      /* 政策解读详情 */
      {
        path: '/gUDetails/:id',
        name: "gUDetails",
        meta: {
          title: '政策解读详情页面'
        },
        component: gUDetails
      },
      /* 政策订阅 */
      {
        path: "/subscriptionpage/:province?/:city?",
        name: "subscriptionpage",
        meta: {
          title: '政策订阅页面'
        },
        component: subscriptionpage
      },
      // 企业认领
      {
        path: "/enterpriseClaim",
        name: "enterpriseClaim",
        meta: {
          title: '企业认领页面'
        },
        component: enterpriseClaim
      },
      /* 企业对比(选择企业) */
      {
        path: "/condition",
        name: "condition",
        meta: {
          title: '企业对比(选择企业)页面'
        },
        component: condition
      },
      /* 企业对比(对比详情) */
      {
        path: "/comparisonDetails",
        name: "comparisonDetails",
        meta: {
          title: '企业对比(对比详情)页面'
        },
        component: comparisonDetails
      },
      /* 企业对比(c查企业) */
      {
        path: "/enterprise",
        // name: "enterprise",
        component: enterprise,
        redirect: "/enterprise/honor",
        children: [{
          /* 查看荣誉 */
          path: "/enterprise/honor/:id?",
          name: "honor",
          meta: {
            title: '查看荣誉页面'
          },
          component: honor
        }, {
          /* 查看专利 */
          path: "/enterprise/patent",
          name: "patent",
          meta: {
            title: '查看专利页面'
          },
          component: patent
        }, {
          /* 查看商标 */
          path: "/enterprise/brand",
          name: "brand",
          meta: {
            title: '查看商标页面'
          },
          component: brand
        }, {
          /* 查看软著 */
          path: "/enterprise/soft",
          name: "soft",
          meta: {
            title: '查看软著页面'
          },
          component: soft
        }]
      },
      /* 企业对比(对比详情) */
      {
        path: "/companyPlolicy",
        name: "companyPlolicy",
        meta: {
          title: '企业关联政策'
        },
        component: companyPlolicy
      },
      // /* 会员中心模块 */
      {
        path: "/VIP",
        name: "VIP",
        component: vip,
        redirect: "/VIP/userInfo",
        children: [{
            /* 浏览历史 */
            path: "/VIP/viewHistory",
            name: "viewHistory",
            meta: {
              title: '浏览历史'
            },
            component: viewHistory
          }, {
            /* 个人中心 */
            path: "/VIP/userInfo",
            name: "userInfo",
            meta: {
              title: '个人中心页面'
            },
            component: userInfo
          }, {
            /* 我的消息 */
            path: "/VIP/information",
            name: "information",
            meta: {
              title: '我的消息页面'
            },
            component: information

          }, {
            /* 我的关注 */
            path: "/VIP/attention",
            name: "attention",
            meta: {
              title: ''
            },
            component: attention,
            redirect: "/VIP/attention/enterprise",
            children: [{
              path: "/VIP/attention/enterprise",
              name: "myEnterprise",
              meta: {
                title: '我关注的企业页面'
              },
              component: vipEnterprise
            }, {
              path: "/VIP/attention/department",
              name: "department",
              meta: {
                title: '我关注的部门页面'
              },
              component: department
            }]
          }, { // 我的企业
            path: "/VIP/company",
            name: "company",
            meta: {
              title: '我的企业页面'
            },
            component: company
          }, {
            /* 我的订单 */
            path: "/VIP/order",
            name: "order",
            meta: {
              title: '我的订单页面'
            },
            component: order
          }, {
            /* 谁看了我 */
            path: "/VIP/discover",
            name: "discover",
            meta: {
              title: '谁看了我页面'
            },
            component: discover

          }, {
            /* 分享统计 */
            path: "/VIP/statistics",
            name: "statistics",
            meta: {
              title: ''
            },
            component: statistics,
          }, {
            path: "/VIP/statistics_setails",
            name: "statistics_setails",
            meta: {
              title: '我的分享阅读信息列表页'
            },
            component: statisticsDetails
          }, {
            // 谁看了我的内页
            path: "/VIP/discover/discover_details",
            name: "discover/discover_details",
            meta: {
              title: '谁看了我内页'
            },
            component: discoveDetails
          }, {
            // 审核列表
            path: "/VIP/toExamine",
            name: "toExamine",
            component: toExamine,
            redirect: "/VIP/toExamine/enterpriseAuditForm",
            children: [{
              path: "/VIP/toExamine/enterpriseAuditForm",
              name: "enterpriseAuditForm",
              meta: {
                title: '审核列表页面'
              },
              component: enterpriseAuditForm
            }]
          },
          {
            path: "/VIP/publishResults",
            name: "publishResults",
            meta: {
              title: '科技成果'
            },
            component: publishResults
          },
          {
            path: "/VIP/publishDemand",
            name: "publishDemand",
            meta: {
              title: '成果需求'
            },
            component: publishDemand
          }
        ]
      },
      {
        /* 测试页 */
        path: "/test",
        mame: "test",
        component: test
      },
      {
        // 活动详情
        path: '/festival',
        name: 'festival',
        meta: {
          title: '活动详情'
        },
        component: festival
      },
      /* 项目查询 */
      {
        path: "/projectQuery",
        name: "projectQuery",
        meta: {
          title: '项目查询页面'
        },
        component: projectQuery
      },
      /* 项目地图 */
      {
        path: "/projectMap",
        name: "projectMap",
        meta: {
          title: '项目地图页面'
        },
        component: projectMap
      }, {
        // 注册
        path: "/register",
        name: "register",
        meta: {
          title: '注册页面'
        },
        component: register
      }, {
        // 空白页
        path: "/blankPage",
        name: "blankPage",
        meta: {
          title: ''
        },
        component: blankPage
      },
      {
        // 忘记密码
        path: "/forget",
        name: "forget",
        meta: {
          title: '忘记密码页'
        },
        component: forget
      },
      /* 园区中心 */
      {
        path: "/ParkCenter",
        name: "ParkCenter",
        meta: {
          title: '园区中心页'
        },
        component: ParkCenter
      },
      /* 园区中心详情*/
      {
        path: "/ParkCenter_details",
        name: "ParkCenter_details",
        meta: {
          title: '园区中心详情'
        },
        component: ParkCenterDetails
      }, {
        // 登录
        path: "/login",
        name: "login",
        meta: {
          title: '登录页面'
        },
        component: login
      }, {
        // 搜索页面
        path: "/search",
        name: "search",
        meta: {
          title: '搜索页面'
        },
        component: search
      },
      {
        path: "/match",
        name: "match",
        meta: {
          title: '搜索'
        },
        component: match
      },
      {
        // 搜索页面
        path: "/aboutUs",
        name: "aboutUs",
        meta: {
          title: '关于我们页面'
        },
        component: aboutUs
      },
      {
        // 调转到荣誉内页
        path: "/policyPage",
        name: "policyPage",
        meta: {
          title: '荣誉内页'
        },
        component: policyPage
      },
      {
        // 调转到荣誉内页
        path: "/publicDetail",
        name: "publicDetail",
        meta: {
          title: '公示名单详情'
        },
        component: publicDetail
      },
      /* 服务商页 */
      {
        path: "/serveDedils",
        name: "serveDedils",
        meta: {
          title: '服务商页'
        },
        component: serveDedils
      },
      /* 服务商详情页 */
      {
        path: "/dedils/:id",
        name: "dedils",
        meta: {
          title: '服务商详情页'
        },
        component: dedils
      }, /* 会员页 */ {
        path: "/pageVIP",
        name: "pageVIP",
        meta: {
          title: '会员页'
        },
        component: pageVIP
      }, {
        // 功能介绍
        path: "/introduce",
        name: "introduce",
        meta: {
          title: '功能介绍页'
        },
        component: introduce
      }, {
        // 附近企业
        path: "/nearbyEnterprise",
        name: "nearbyEnterprise",
        meta: {
          title: '附近企业页'
        },
        component: nearbyEnterprise
      }, {
        // 最新资讯
        path: "/newInform/:id",
        name: "newInform",
        meta: {
          title: '最新资讯'
        },
        component: newInform
      }, {
        // 绑定手机号
        path: '/bindPhoneNumber',
        name: 'bindPhoneNumber',
        meta: {
          title: '绑定手机号'
        },
        component: bindPhoneNumber
      }, {
        // 专利列表
        path: '/patentList',
        name: 'patentList',
        meta: {
          title: '专利列表'
        },
        component: patentList
      }, {
        // 专利缴费
        path: '/patentPayment',
        name: 'patentPayment',
        meta: {
          title: '专利缴费'
        },
        component: patentPayment
      }, {
        //专利搜索
        path: '/patentSearch',
        name: 'patentSearch',
        component: patentSearch
      }, {
        // 专利号搜索详情
        path: '/patentDetail',
        name: 'patentDetail',
        component: patentDetail
      }, {
        // 企业测评
        path: '/evaluation',
        name: 'evaluation',
        component: evaluation
      },
      {
        // 成果详情
        path: '/achievDetail/:id',
        name: 'achievDetail',
        component: achievDetail
      },
      {
        // 成果列表
        path: '/achievList',
        name: 'achievList',
        component: achievList
      },
      {
        // 需求详情
        path: '/demandDetail/:id',
        name: 'demandDetail',
        component: demandDetail
      },
      {
        // 需求列表
        path: '/demandList',
        name: 'demandList',
        component: demandList
      },
      {
        // 服务商列表
        path: '/companyService',
        name: 'companyService',
        component: companyService
      },
      {
        // 企业测评首页
        path: '/declareIndex',
        name: 'declareIndex',
        component: declareIndex
      },
    ]
  })
  return router
}
